<?php
$section = 'testimonial';

$titre = _LB_TESTIMONIAL_MANAGEMENT;
$smarty->assign("titre", $titre);

Session::setBackLink($section);
$filter = array();
if(isset($_GET['STATUS'])){
    $filter["STATUS"] = Request::get('STATUS');
}
else{
    $filter["STATUS"] = -1;
}
$testiminial = new Testimonial();
if($filter["STATUS"] == -1){
    $query = "SELECT * FROM TESTIMONIAL ORDER BY POS ASC";
}
else{
    $query = "SELECT * FROM TESTIMONIAL WHERE STATUS = ".$filter["STATUS"]." ORDER BY POS ASC";
}
$args = array();
$pager = new  DBPager($testiminial,$args, false ,PAGING_DEFAULT_ITEM_PER_PAGE,$query);
$testiminial->query($query);
$cfer = new Cfer(array(
	_LB_ACCUEIL => Utils::getHomeLink(),
	_LB_TESTIMONIAL_MANAGEMENT => Utils::getCurrentLink()));
$smarty->assign('cfer', $cfer);
$smarty->assign('testimonial', $testiminial);
$smarty->assign('pager', $pager);
$smarty->assign('filter', $filter);
$smarty->display('testimonial_list.html');